<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <?php include_http_metas() ?>
    <?php include_metas() ?>
    <?php include_title() ?>
    <!-- <link rel="shortcut icon" href="/favicon.ico" /> -->
    <?php include_stylesheets() ?>
    <?php include_javascripts() ?>

 </head>

	<body>
	<?php if($sf_user->isAuthenticated()) :?>
	<div id="overLayout" style="position:relative;z-index:3;width:100%">
		<div id="menubar" ></div>
		<?php if (has_slot("toolbar")): ?>
			<?php include_slot("toolbar"); ?>
		<?php endif;?>
	</div>
	<input type="hidden" value="<?php echo url_for('main/projectList') ?>" name="openHref" />
	<input type="hidden" value="<?php echo url_for('importMedia/index') ?>" name="importOnclick" />
	<input type="hidden" value="<?php echo url_for('main/projectList') ?>" name="projectHref" />
	<input type="hidden" value="<?php echo url_for('exportToLuna/index')?>" name="exportHref" />
	<input type="hidden" value="<?php echo url_for('projectOptions/index')?>" name="optionsHref" />
	<input type="hidden" value="<?php echo $sf_user->getUserName()?>" name="username" />
	<input type="hidden" value='<?php echo link_to('Logout', '@sf_guard_signout') ?>' name="exitATag" />
	<div id="container">
	
		<div id="session_id" style="display:none;visibility:hidden;position:absolute;"><?php echo session_id(); ?></div>

			<!-- manually attach allowOverflow method to pane -->
				<!-- allowOverflow auto-attached by option: west__showOverflowOnHover = true -->
			<?php if (has_slot("choice")): ?>
			<?php include_slot("choice"); ?>
			<?php endif;?>
			
			<?php if (has_slot("successMessages")): ?>
			<div class="successMessages popup " onclick="closeDiv(this)" title="Click to close">	
				<?php include_slot("successMessages"); ?>
			</div>
			<?php endif;?>
			
			<?php if (has_slot("errorMessages")): ?>
			<div class="errorMessages popup " onclick="closeDiv(this)" title="Click to close">	
				<?php include_slot("errorMessages"); ?>
			</div>
			<?php endif;?>
			
			<?php //flash?>
			<?php if ($sf_user->hasFlash('success')): ?>
			<div class="successMessages popup " onclick="closeDiv(this)" title="Click to close">	
				<?php echo $sf_user->getFlash('success'); ?>
			</div>
			<?php elseif ($sf_user->hasFlash('error')): ?>
			<div class="errorMessages popup " onclick="closeDiv(this)" title="Click to close">	
				<?php echo $sf_user->getFlash('error'); ?>
			</div>
			<?php endif;?>		
			
		<div class="ui-layout-center">
			<div id="tooltip"></div>
			<div id="hideWest">
				<img class="button" id="westOpen" title="restore Toolbox" src="/images/maximize.png" onclick="myLayout.open('west')" />
			</div>
			<div id="edit" class="elementView"></div>
			<div id="new" class="elementView"></div>
			<div id="editFeatDef" class="elementView"></div>
			<div id="open" class="elementView"></div>	
				
			<div id="content" style="padding:0"> 
			<?php echo $sf_content ?>
				<!-- <div id="whiteboard">
					
				</div> -->
			</div>
		</div>
	</div>
	<?php else: ?>
	<div id="loginDiv">
		<div class="title">
			<h1>LIAnnot</h1>
		</div>
		<div class="formContent">
			<?php echo $sf_content ?>
			<a id="registerLink" style="float:left"href="<?php echo url_for("user/register")?>" >Register</a>
		</div>
	</div>
	
	<?php endif; ?>
	</body>

</html>